package jp.dev7.enchant.tot.controller.test;

import jp.dev7.enchant.tot.service.IssueIdService;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

import com.google.appengine.api.channel.ChannelService;
import com.google.appengine.api.channel.ChannelServiceFactory;

public class ChannelTestController extends Controller {

    private IssueIdService issueIdService = new IssueIdService();
    private ChannelService channelService = ChannelServiceFactory
        .getChannelService();

    @Override
    protected Navigation run() throws Exception {
        String userId = issueIdService.issue();
        String token = channelService.createChannel(userId);

        requestScope("userId", userId);
        requestScope("token", token);

        return forward("channelTest.jsp");
    }
}
